<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@include file="../common/jspcommon.jsp"%>

<script type="text/javascript">
$(function(){
	$.metadata.setType("attr","validate");
	$("#album_add_form").validate({
			submitHandler: function() {
			$.post("albumAddSave.htm",{
				"name":$("#name").val(),
				"place":$("#place").val(),
				"description":$("#description").val(),
				"visibility":$("#visibility").val()
			},function(data){
				$("#upload_photo_album_select").append('<option value="'+data.identifier+'" selected>'+data.name+'</option>');
				$("#upload_photo_add_album").empty();
				$("#upload_photo_add_album").hide();
			},"json");
		}
		
	});
	
});

function albumAddCancel(){
	$("#upload_photo_add_album").empty();
	$("#upload_photo_add_album").hide();
}
</script>

<form action="" id="album_add_form">
	<div class="create_photoBox">
		<h4>
			<a href="javascript:void(0);" onclick="albumAddCancel();"></a>创建新的照片专辑
		</h4>
		<div class="create_photo">
			<table>
				<tr>
					<td class="create_photoText" >专辑名称：</td>
					<td><input id="name" name="name" type="text" style="width: 150px;" maxlength="50" validate="{required:true,messages:{required:'不能为空'}}"/>
					</td>
				</tr>
				<tr>
					<td class="create_photoText">地点：</td>
					<td><input type="text" style="width: 150px;" name="place" id="place" maxlength="100"/>
					</td>
				</tr>
				<tr>
					<td class="create_photoText">详细描述：</td>
					<td><textarea id="description" name="description" style="width: 150px;" validate="{maxlength:800}"></textarea>
					</td>
				</tr>
				<tr>
					<td class="create_photoText">访问权限：</td>
					<td><select name="visibility" id="visibility">
							<option value="02">仅邻居</option>
							<option value="01">任何人都可以</option>
					</select></td>
				</tr>
				<tr>
					<td></td>
					<td>
						<div class="h_button fl mr5" onclick="$('#album_add_form').submit();"><strong>创 建</strong></div>
						<div class="h_button fl" onclick="albumAddCancel();"><strong>取消</strong></div>
					</td>
				</tr>
			</table>
		</div>
	</div>
</form>

